package com.dyc.caradvertisting.ui.fmt.find;

import com.dyc.caradvertisting.bean.req.RequestBean;
import com.dyc.caradvertisting.constants.Constant;
import com.dyc.caradvertisting.ui.fmt.register.RegisterContract;
import com.njh.tools.common.ToastUtils;

import java.util.Map;

import rx.Observable;
import rx.Observer;


/**
 * Created by niejiahuan on 2016/5/31.
 */
public class FindPwdPresenter extends FindPwdContract.Presenter {


    @Override
    public Observable getDate(Map<String, String> params) {
        return null;
    }

    @Override
    public void onStart() {

    }


    @Override
    public void reqChangePassword(String param) {
        RequestBean requestBean=new RequestBean(Constant.REQ_CHANGE_PASSWORD,param);
        mModel.reqChangePassword(requestBean.getAct()+"",
                requestBean.getAct()+"",
                requestBean.getParam(),
                requestBean.getSign(),
                requestBean.getStrtime()+"")
                .subscribe(new Observer() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {
                        mView.showError(e);
                    }

                    @Override
                    public void onNext(Object o) {
                        ToastUtils.showLong(mContext,"注册成功,请登录");
                        mView.finish();
                    }
                });

    }

    @Override
    public void reqUserSendMessage(String param) {

    }
}
